package com.joe.springboot.web;


import com.joe.springboot.dmo.User;
import com.joe.springboot.service.HomeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Repository;
import org.springframework.web.bind.annotation.*;

@RestController
public class HomeController {

    @Autowired
    @Qualifier("homeService")
    private HomeService homeService;

    @PostMapping("/home")
    public User home(@RequestBody User user) {
        return homeService.queryUser("xxxx", user);
    }

    @PostMapping("/cal/{a}/{b}")
    public int cal(@PathVariable int a, @PathVariable int b) {
        return homeService.calResult(a, b);
    }


}
